package day06Case01;

/**
 * @author Xiao
 * @date 2021/7/6
 */
public class PaperZMLM {
    /**
     *      需求：
     *          纸张（0.1）对折多少次可以超过珠穆朗玛峰（8844430）的高度
     */
    public static void main(String[] args) {
        double paper = 0.1;
        double ZMLM = 8844430;
        int count = paperZMLM(paper, ZMLM);
        System.out.println("count:" + count);
    }

    public static int paperZMLM(double a, double b) {
        int count = 0;
        for (double i = a; i <= b; i *= 2) {
            count++;
        }
        return count;
    }
}
